﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LibraryManagementSystem
{
    class LibrarySystemStart : ViewClassCheckInputValue, interfaceNodeClass
    {
        BorrowingAndReturningBookSystem _BorrowingAndReturningBookSystem;
        BookManageClass _BookManageClass;


        public LibrarySystemStart( ) 
        {
           
        }

        public void Running(Library library) 
        {

            while ( true ) 
            {
                Console.Clear();
                Console.WriteLine("欢迎进入图书综合管理系统");
                Console.WriteLine("请输入您需要的业务号码");
                Console.WriteLine("1.借书与还书");
                Console.WriteLine("2.管理图书");
                Console.WriteLine("3.展示库存信息");
                Console.WriteLine("4.退出系统");


                string num = Console.ReadLine().Trim();
                switch (num) 
                {
                    case "1":
                        _BorrowingAndReturningBookSystem = new BorrowingAndReturningBookSystem();
                        _BorrowingAndReturningBookSystem.Running(library);
                        break;
                    case "2":
                        _BookManageClass = new BookManageClass();
                        _BookManageClass.Running(library);
                        break;
                    case "3":
                        library.ShowAllBookDataToConsole();
                        Console.ReadKey();
                        break;
                    case "4":
                        PromptWait("退出系统");
                        End();
                        return;
                    default:
                        PromptWait("指令错误");
                        break;
                
                }




            }


        }

        //预留的方法
        public void End() 
        { 
        }



    }
}
